﻿using System;
using System.Collections.Generic; 
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class shuangsechfb : System.Web.UI.Page
{
    protected List<Model.LotteryAnnouncement> arlist = null;
    protected Model.LotteryAnnouncement modelFlag= null; 
    protected string[] SSQList = null;
    protected string SSQblue = null; 
    protected int jinqiCount = 0;

    protected void Page_Load(object sender, EventArgs e)
    {
        ZoushiManage.FangWenZouShi();
        if (!IsPostBack)
        {
            jinqiCount = 30;
            bindData(30);
        } 
    }

    protected void bindData(int maxValue)
    {

        int Count = 0;
        arlist = BLL.LotteryAnnouncement.GetPageList_Where(0, maxValue, 1, out  Count);

        if (arlist != null)
        { 
            for (int i = 0; i < arlist.Count; i++)
            { 
                //重号
                string[] redBall = arlist[i].LotteryNo.Split('+')[0].Split(','); 
                for (int m = 0; m < redBall.Length; m++)
                {
                    //计算条形图中每个数的个数红球
                    bindTiaoxing(0,int.Parse(redBall[m]));
                     
                }

                bindTiaoxing(1, int.Parse(arlist[i].LotteryNo.Split('+')[1]));
            } 
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        jinqiCount = int.Parse(DropDownList1.SelectedValue);
        bindData(int.Parse(DropDownList1.SelectedValue));
    }
    protected int[] TiaoxingDT = new int[49];
    /// <summary>
    /// 计算红篮球的出现个数
    /// </summary>
    /// <param name="type">0 红球 1 蓝球</param>
    /// <param name="data">对应球的号码</param>
    protected void bindTiaoxing(int type,int data)
    {
        for (int i = 0; i < 49; i++)
        {
            if (type == 0)
            {
                if (data == (i + 1))
                {
                    TiaoxingDT[i] += 1;
                }
            }
            if (type == 1)
            {
                if (data == (i + 1-33))
                {
                    TiaoxingDT[i] += 1;
                }
            }
        }
    }
}